<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class WxCardExt extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //卡券投放二维码
        Schema::create('wx_card_exts', function (Blueprint $table) {
            $table->increments('id')->comment('自增序号');
            $table->unsignedInteger('card_base_id')->default(0)->comment('卡券主键唯一ID');
            $table->string('card_id', 200)->default('')->comment('微信卡券ID');
            $table->unsignedInteger('least_cost')->default(0)->comment('代金券专用，表示起用金额（单位为分）');
            $table->unsignedInteger('reduce_cost')->default(0)->comment('代金券专用，表示减免金额');
            $table->unsignedInteger('discount')->default(0)->comment('	折扣券专用，表示打折额度（百分比）。填30就是七折');
            $table->text('deal_detail')->nullable()->comment('团购券专用，团购详情');
            $table->text('gift')->nullable()->comment('兑换券专用，填写兑换内容的名称');
            $table->text('default_detail')->nullable()->comment('优惠券专用，填写优惠详情');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wx_card_exts');
    }
}
